package mt.omid.jscap;

/****
 * Create by Omid Mehdizadeh
 * Copyright 2010, Omid Mehdizadeh
 * Based on JDiameter Open Source Project
 */

import static mt.omid.jscap.SCAPCode.ERICSSON_VENDOR_ID;
import static mt.omid.jscap.SCAPCode.SCAP_AVP_Service_Parameter_Info;
import static mt.omid.jscap.SCAPCode.SCAP_AVP_Service_Parameter_Type;
import static mt.omid.jscap.SCAPCode.SCAP_AVP_Service_Parameter_Value;
import static mt.omid.jscap.SCAPCode.SRV_PRM_INF_SERVICE_PROVIDER_ID;

import org.jdiameter.api.AvpSet;
import org.jdiameter.api.Request;


public class Tools
{

    public static Request addServiceParamInfo( Request req, int type, int val )
    {
	AvpSet srvParamInfo = req.getAvps().addGroupedAvp( SCAP_AVP_Service_Parameter_Info,
		ERICSSON_VENDOR_ID, true, false );
	srvParamInfo
		.addAvp( SCAP_AVP_Service_Parameter_Type, type, ERICSSON_VENDOR_ID, true, false );
	srvParamInfo
		.addAvp( SCAP_AVP_Service_Parameter_Value, val, ERICSSON_VENDOR_ID, true, false );
	return req;
    }

    public static Request addServiceParamInfo( Request req, int type, String val )
    {
	AvpSet srvParamInfo = req.getAvps().addGroupedAvp( SCAP_AVP_Service_Parameter_Info,
		ERICSSON_VENDOR_ID, true, false );
	srvParamInfo
		.addAvp( SCAP_AVP_Service_Parameter_Type, type, ERICSSON_VENDOR_ID, true, false );
	srvParamInfo.addAvp( SCAP_AVP_Service_Parameter_Value, val, ERICSSON_VENDOR_ID, true,
		false, false );
	return req;
    }
}
